package com.blue.blueB2020;

/**
 * @auther zsj
 * @Date 2021/12/15
 **/
public class Demo01 {
    public static void main(String[] args) {
        int count =0;
        for (int i = 1; i <= 2020; i++) {
            String temp = ""+i;
            char[] chars = temp.toCharArray();
            for (int j = 0; j < chars.length; j++) {
                if (chars[j]=='2'){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}
